function BlockUi(){
	var screenId = "blockUi";
	var progressId = "animUi";
	var divScreen = "";
	divScreen += "<div id='"+screenId+"' style='position:absolute;top:0;left:0;z-index:9999;'>";
	divScreen += "<div id='"+progressId+"' style='position:absolute;z-index:9998;border:1px solid black;background:#fff;'>";
	divScreen += "<img src='/resources/images/common/ajax-loader.gif' style='border:0px solid red;' />";
	divScreen += "</div>";	
	divScreen += "</div>";
	
	this.block = function(opts){		
		$("body:has(#"+screenId+")").each(function(){ $("#"+screenId).remove(); });
		
		$("body").append(divScreen);
		$("#"+screenId).css("width", document.body.scrollWidth+"px");
		$("#"+screenId).css("height", document.body.scrollHeight+"px");
		$("#"+progressId).css("top", ($(window).height()/2)+document.documentElement.scrollTop+"px");
		$("#"+progressId).css("left", ($(window).width()/2)+document.documentElement.scrollLeft+"px");
		$("#"+progressId).css("width", "16px");
		$("#"+progressId).css("height", "16px");

		var background = (typeof opts.bgcolor == "string") ? opts.bgcolor : "white";
		var opacity = (typeof opts.opacity == "number") ? opts.opacity : 0.5;
		var animation = (typeof opts.animation == "boolean") ? opts.animation : false;
		
		$("#"+screenId).css("background", background);
		$("#"+screenId).css("opacity", opacity);
		if(!animation){ $("#"+progressId).remove(); }
	};
	
	this.unblock = function(){ 
		$("#"+screenId).remove();
	};

	this.showAnimation = function(){ $("#"+progressId).removeCss("display"); };
	this.hideAnimation = function(){ $("#"+progressId).css("display", "none"); };
	
}